<template>
  <el-button @click="openDialog">打开弹窗</el-button>
  <Dialog v-model:visible="dialogVisible" :user="selectedUser" />
</template>

<script lang="ts" setup>
import { ref } from 'vue'
// 导入子组件
import Dialog from './components/index.vue'

const dialogVisible = ref(false)
const selectedUser = ref({ id: 1, name: '唐仲喝' })

const openDialog = () => {
  selectedUser.value
  dialogVisible.value = true
}
</script>
